#pragma once
#include "Vector.h"
#include "Matrices.h"
#include <glm\ext\vector_float3.hpp>
#include <glm\ext\matrix_float4x4.hpp>

class ShaderProgram
{
private:
	int vertextShaderId;
	int fragmentShaderId;
	int programId;

	const char* vertexFilePath;
	const char* fragmentFilePath;
public:
	ShaderProgram(const char* vertexShaderPath, const char* fragmentShaderPath);

	void start();

	void stop();

	void cleanUp();

	void reloadShader();

	int getProgramId() { return programId; }

	int getUniformLocation(const char* uniformName);
	virtual void getAllUniformLocation() {}
	void loadDouble(int location, double value);
	void loadFloat(int location, float value);
	void loadInt(int location, int value);
	void loadBoolean(int location, bool value);
	void loadVector(int location, struct GLMath::Vector3 vector);
	void loadMatrix(int location, class GLMath::Matrix4 matrix);

	void setInt(const char* name, int value);
	void setFloat(const char* name, float value);
	void setDouble(const char* name, float value);
	void setBoolean(const char* name, float value);
	void setVec3(const char* name, glm::vec3& value);
	void setVec3(const char* name, float x, float y, float z);
	void setMat4(const char* name, glm::mat4& value);
private:
	int loadShader(const char* filePath, int type);

	int createProgram();
};

